
import java.util.Scanner;

public class Fenjieyinshu {
    public static void main(String[] args) {
        Scanner reader=new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int n=reader.nextInt();
        boolean flag=panduan(n);
        if (flag){
            System.out.print(n+"=");
            for (int i=2;i<=n;i++){
                while (n!=i){
                    if (n/i==0){
                        System.out.print(i+"*");
                       n=n/i;
                    }else {
                        break;
                    }

                }
            }
            System.out.println(n);
        }else {
            System.out.println(n+"为素数");
            System.out.println("该素数分解为："+n+"=1"+"*"+n);
        }
    }
public static boolean panduan(int n){
    int num=0;
    for (int i=2;i<n;i++){
      if(n/i==0){
          num++;
      }
    }
    if (num>0){
        return true;
    }else {
        return false;
    }
}
}

